<?php

/**
 * Fixture filter form base class.
 *
 * @package    prode
 * @subpackage filter
 * @author     Your name here
 */
abstract class BaseFixtureFormFilter extends BaseFormFilterPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'anho'         => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'torneo_id'    => new sfWidgetFormPropelChoice(array('model' => 'Torneo', 'add_empty' => true)),
      'temporada_id' => new sfWidgetFormPropelChoice(array('model' => 'Temporada', 'add_empty' => true)),
      'fechanro'     => new sfWidgetFormFilterInput(),
      'activo'       => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'finalizado'   => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
    ));

    $this->setValidators(array(
      'anho'         => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'torneo_id'    => new sfValidatorPropelChoice(array('required' => false, 'model' => 'Torneo', 'column' => 'id')),
      'temporada_id' => new sfValidatorPropelChoice(array('required' => false, 'model' => 'Temporada', 'column' => 'id')),
      'fechanro'     => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'activo'       => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'finalizado'   => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
    ));

    $this->widgetSchema->setNameFormat('fixture_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Fixture';
  }

  public function getFields()
  {
    return array(
      'id'           => 'Number',
      'anho'         => 'Number',
      'torneo_id'    => 'ForeignKey',
      'temporada_id' => 'ForeignKey',
      'fechanro'     => 'Number',
      'activo'       => 'Boolean',
      'finalizado'   => 'Boolean',
    );
  }
}
